package com.baidu.fsg.uid.worker.entity;

import javax.annotation.Generated;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

import lombok.Data;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;


/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @description TODO
 * @site https://fzh.cloud/
 * @company 
 * @create 2020-9-1 16:51
 */

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "t_worker_node")
public class WorkerNode implements Serializable,Cloneable{

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "c_id",unique = true,nullable=false)
    private Long id;

    @Column(name = "c_host_name",nullable=false)
    private String hostName;

    @Column(name = "c_port",nullable=false)
    private String port;

    @Column(name = "c_type",nullable=false)
    private Integer type;

    @Column(name = "c_launch_date",nullable=false)
    private Date launchDate = new Date();



    @Version
    @Column(name = "c_revision")
    private Integer revision;

    @Column(name = "c_created_by")
    private Long createdBy = 0L;

    @Column(name = "c_created_time",insertable = false,updatable = false)
    private Date createdTime;

    @Column(name = "c_updated_by")
    private Long updatedBy = 0L;

    @Column(name = "c_updated_time",insertable = false,updatable = false)
    private Date updatedTime;
}